/**
 * [使用方法]
 * <Buttom
      key={i}
      containerStyle = {
        [BrandNameStyle, isSelect ? { backgroundColor: 'rgb(240, 240, 240)', borderRightWidth: 0 } : { backgroundColor: '#fcfcfc', borderRightWidth: 1 / PixelRatio.get() }]
      }
      style={[{ fontSize: 16, textAlign: 'center' },
        isSelect ? { color: 'red' } : { color: 'black' }]}
      text={object.name}
      onPress={() => {
        Array.map((object, i) => {
          Array[i] = 0;
        });
        Array.splice(i, 1, 1);
        this.setState({
          defaultNum: i,
          selectArray: Array,
        });
        InteractionManager.runAfterInteractions(() => {
          const {dispatch} = this.props;
          dispatch(BrandAction(i + 1, tag, offest, limit, isRefreshing, isLoading));
        });

      } }
      />
 * @type {Object}
 */
import React from 'react';
import {
    View,
    Text,
    TouchableOpacity
} from 'react-native';
import PropTypes from 'prop-types';
const propTypes = {
    onPress: PropTypes.func,
    disabled: PropTypes.bool,
    style: Text.propTypes.style,
    containerStyle: View.propTypes.style,
    text: PropTypes.string
};

const LmbButton = ({ onPress, disabled, style, containerStyle, text }) => (
    <TouchableOpacity
        onPress={onPress}
        disabled={disabled}
        activeOpacity={0.75}
        >
        <View style={containerStyle}>
            <Text style={style}>
                {text}
            </Text>
        </View>
    </TouchableOpacity>
);

LmbButton.propTypes = propTypes;

LmbButton.defaultProps = {
    onPress() { },
    disabled: false
};

export default LmbButton;
